package com.longkier.gx_library_springboot.repository;

import com.longkier.gx_library_springboot.entity.BooksBorrow;
import org.springframework.data.domain.Page;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface BooksBorrowRepository extends JpaRepository<BooksBorrow, Long> {

    /**
     * 查询所有借阅记录，按创建时间降序排序
     *
     * @param pageable 分页参数
     * @return 借阅记录列表
     */
    Page<BooksBorrow> findAllByOrderByCreateTimeDesc(org.springframework.data.domain.Pageable pageable);

    List<BooksBorrow> findByCardNumber(String cardNumber);
}
